package com.qf.day03;

public class Utile {
    /**
     * 返回1到100的和
     * @return
     */
    public static int sumOntTo100(){
        int sum = 0;
        for (int i = 1; i <= 100; i++) {
            sum+=i;
        }
        return sum;
    }

    /**
     * 计算阶层
     * @param num  传入的参数，计算几的阶层
     * @return  阶层
     */
    public static long jieCheng(int num){
        long result = 1;
        for (int i = 1; i <= num ; i++) {
            result*=i;
        }
        return result;
    }


}
